#!/bin/sh
    cd "$(dirname "$0")"
	now=`date "+%Y%m%d"`
    export JRE_HOME=jre
    export R_HOME=R
    export CLASSPATH=.:${CLASSPATH}:${JRE_HOME}/lib:${JRE_HOME}/lib/server:${R_HOME}/library/rJava/jri
    export PATH=${JRE_HOME}/bin:${R_HOME}/bin:${PATH}:${HOME}/bin
    : ${R_JAVA_LD_LIBRARY_PATH=}
    if test -n ""; then
    : ${R_LD_LIBRARY_PATH=${R_HOME}/lib:}
    else
    : ${R_LD_LIBRARY_PATH=${R_HOME}/lib}
    fi
    if test -n "${R_JAVA_LD_LIBRARY_PATH}"; then
      R_LD_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${R_JAVA_LD_LIBRARY_PATH}"
    fi
    if test -z "${DYLD_FALLBACK_LIBRARY_PATH}"; then
      DYLD_FALLBACK_LIBRARY_PATH="${R_LD_LIBRARY_PATH}"
    else
      DYLD_FALLBACK_LIBRARY_PATH="${R_LD_LIBRARY_PATH}:${DYLD_FALLBACK_LIBRARY_PATH}"
    fi
    export DYLD_FALLBACK_LIBRARY_PATH

    exec java -Xmx1200M -Xms1200M -Xmn500M -Xss256K -XX:SurvivorRatio=3 -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses -XX:MaxTenuringThreshold=3 -XX:AutoBoxCacheMax=20000 -XX:SoftRefLRUPolicyMSPerMB=200 -XX:LargePageSizeInBytes=128M -XX:+UseFastAccessorMethods -Djava.library.path=${R_HOME}/library/rJava/jri -jar ispc_desktop.jar  --spring.profiles.active=dev 5 >> log/ispc_"$now".log &

